﻿@{
    ViewData["Title"] = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";

    var logLevel = Enum.GetNames(typeof(LogLevel));
}
<div class="card border-primary">
    <div class="card-body text-primary">
        <form class="row g-3" id="searchParams">
            <div class="col-md-4">
                <label for="Level" class="form-label">Level</label>
                <select class="form-select" required name="LogLevel">
                    @foreach (var item in logLevel)
                    {
                        @if (item == "Error")
                        {
                            <option selected value="@item">@item</option>
                        }
                        else
                        {
                            <option value="@item">@item</option>
                        }
                    }
                </select>
            </div>

            <div class="col-md-4">
                <label for="Message" class="form-label">Message</label>
                <input type="text" class="form-control" name="Message">
            </div>
            <div class="col-md-4">
                <label for="SourceContext" class="form-label">SourceContext</label>
                <input type="text" class="form-control" name="SourceContext">
            </div>
            <div class="col-md-4">
                <label for="FilePath" class="form-label">FilePath</label>
                <input type="text" class="form-control" name="FilePath">
            </div>
            <div class="col-md-4">
                <label for="MemberName" class="form-label">MemberName</label>
                <input type="text" class="form-control" name="MemberName">
            </div>
            <div class="col-12">
                <button class="btn btn-primary" type="button" id="search">Search</button>
            </div>
        </form>
    </div>
</div>
<table id="logTable" url="@Url.Content("~/SystemLog/PageList")"></table>
<div id="toolbar">
    <button type="button" class="btn btn-primary" id="delete" url="@Url.Content("~/SystemLog/Delete")">Delete</button>
</div>
@section Scripts{
    <script src="~/lib/bootstrap-table/log-table.js?t=@DateTime.Now"></script>
}
